package m202405.d13;

/**
 * @@author: 爱做梦的锤子
 * @date: 2024/5/13 12:32
 */
public class Q226 {
    public TreeNode invertTree(TreeNode root) {
        if (root == null) {
            return null;
        }
        TreeNode left = root.left;
        TreeNode right = root.right;
        root.left = invertTree(right);
        root.right = invertTree(left);
        return root;
    }
}
